const fs = require('fs');

let rs = fs.createReadStream('D:\\BaiduNetdiskDownload\\jdk-6u45-windows-x64.exe');

let ws = fs.createWriteStream('D:\\BaiduNetdiskDownload\\jdk-6u45-windows-x64-2.exe');

rs.pipe(ws);

// 监听数据流
let count = 0;
rs.on('data', (chunk) => {
    ++count;
    //console.log(chunk);
});

rs.on('end', () => {
    console.log(count);
});